package com.xuecheng.content.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xuecheng.content.model.dto.TeachplanDto;
import com.xuecheng.content.model.po.DeleteTeachplan;
import com.xuecheng.content.model.po.MoveTeachplan;
import com.xuecheng.content.model.po.Teachers;
import com.xuecheng.content.model.po.Teachplan;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 课程计划 Mapper 接口
 * </p>
 *
 * @author itcast
 */
public interface TeachplanMapper extends BaseMapper<Teachplan> {
    //课程计划查询
    public List<TeachplanDto> selectTreeNodes(Long courseId);
    //查询该课程计划是否有细分
    public Long countById(Long id);
    //查询课程计划的层级和课程计划父级ID
    public DeleteTeachplan selectGradeParentId(Long id);
    //删除课程计划
    public void deleteTeachplan(Long id);
    //查询课程计划中的parentid,course_id,orderBy
    public MoveTeachplan selectMoveIds(Long id);
    //查询大章节的章节数目
    public Long counts(Long countId);
    //查询小章节的章节数目
    public Long smallcounts(Long parentId);
    //根据orderby和course_id查询课程计划的Id
    public Long teachPlanIdByOrderByAndCourseId(@Param("orderBy") Long orderBy,@Param("courseId") Long courseId);
    //根据orderby和parentid查询课程计划的Id
    public Long teachPlanIdByOrderByAndParentId(@Param("orderBy") Long orderBy,@Param("parenId") Long parenId);
    //更新课程计划的排序
    public void updateTeachPlanOrderBy(@Param("id") Long id,@Param("orderBy") Long orderBy);
    //根据课程Id查询教师
    public List<Teachers> getTeachersByCourseId(Long id);
    //新增教师
    public Long saveTeacher(Teachers teacher);
    //修改教师
    public void updateTeacher(Teachers teachers);
    //删除教师
    void deleteTeacher(@Param("courseId") Long courseId,@Param("teacherId") Long teacherId);
    //删除课程相关的基本信息
    void deleteCourseBase(@Param("courseId") Long courseId);
    //删除课程相关的营销信息
    void deleteCourseMarket(@Param("courseId") Long courseId);
    //删除课程相关的课程计划中的课程信息
    void deleteTeachPlanCourse(@Param("courseId") Long courseId);
    //删除课程相关的课程计划中的媒资信息
    void deleteTeachPlanMedia(@Param("courseId") Long courseId);
    //删除课程相关的课程计划中的作业信息
    void deleteTeachWork(@Param("courseId") Long courseId);
    //删除课程相关的课程教师信息
    void deleteTeacherByCourseId(@Param("courseId") Long courseId);
}
